<?php

require_once('classes/ticketproviders/transavia.class.php');
require_once('classes/ticketproviders/vliegfabriek.class.php');
require_once('classes/ticketproviders/corendon.class.php');
require_once('classes/ticketproviders/easyjet.class.php');
require_once('classes/ticketproviders/ebookers.class.php');

class Tickets {

    private $allTickets = array();

    public function Tickets($searchQuery) {
        $transavia = new Transavia($searchQuery);
        $vliegfabriek = new Vliegfabriek($searchQuery);
        $corendon = new Corendon($searchQuery);
        //$easyjet = new Easyjet($searchQuery);
        $ebookers = new Ebookers($searchQuery);

        //Airberlin hoeft nog niet
        //$easyjet->getTickets($this->ticketIndex());
        $ebookers->getTickets($this->ticketIndex());

        $this->allTickets += $transavia->getTickets($this->ticketIndex());
        $this->allTickets += $vliegfabriek->getTickets($this->ticketIndex());
        $this->allTickets += $corendon->getTickets($this->ticketIndex());
    }

    public function addTickets($ticket) {
        array_push($this->allTickets, $ticket);
    }

    public function ticketIndex() {
        return count($this->allTickets);
    }

    public function getAllTickets() {
        return $this->allTickets;
    }

}